package com.smartaccounting.model;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

public class Income {
    private int incomeId;
    private int userId;
    private BigDecimal amount;
    private String category;
    private String source;
    private LocalDate incomeDate;
    private String description;
    private LocalDateTime createdAt;

    // 无参构造方法
    public Income() {}

    // 全参构造方法
    public Income(int incomeId, int userId, BigDecimal amount, String category,
                  String source, LocalDate incomeDate, String description,
                  LocalDateTime createdAt) {
        this.incomeId = incomeId;
        this.userId = userId;
        this.amount = amount;
        this.category = category;
        this.source = source;
        this.incomeDate = incomeDate;
        this.description = description;
        this.createdAt = createdAt;
    }

    // 添加收入用构造方法
    public Income(int userId, BigDecimal amount, String category,
                  String source, LocalDate incomeDate, String description) {
        this.userId = userId;
        this.amount = amount;
        this.category = category;
        this.source = source;
        this.incomeDate = incomeDate;
        this.description = description;
    }

    // Getter 和 Setter 方法
    public int getIncomeId() {
        return incomeId;
    }

    public void setIncomeId(int incomeId) {
        this.incomeId = incomeId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public LocalDate getIncomeDate() {
        return incomeDate;
    }

    public void setIncomeDate(LocalDate incomeDate) {
        this.incomeDate = incomeDate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public String toString() {
        return "Income{" +
                "incomeId=" + incomeId +
                ", userId=" + userId +
                ", amount=" + amount +
                ", category='" + category + '\'' +
                ", source='" + source + '\'' +
                ", incomeDate=" + incomeDate +
                ", description='" + description + '\'' +
                '}';
    }
}